﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_KhachHangTraHang : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvKhachHang")]
        private ADVObjects _AdvKhachHang;
        [AccessedThroughProperty("AdvTaiKhoanCo")]
        private ADVAccount _AdvTaiKhoanCo;
        [AccessedThroughProperty("AdvTaiKhoanThue")]
        private ADVAccount _AdvTaiKhoanThue;
        [AccessedThroughProperty("AdvTaiKhoanTraHang")]
        private ADVAccount _AdvTaiKhoanTraHang;
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTab2")]
        private C1DockingTab _C1DockingTab2;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("CboKhaiThue")]
        private ComboBox _CboKhaiThue;
        [AccessedThroughProperty("CboLoaiHoaDon")]
        private ComboBox _CboLoaiHoaDon;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdBoGhiSo")]
        private ToolStripButton _CmdBoGhiSo;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdGhiSo")]
        private ToolStripButton _CmdGhiSo;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdTimHoaDon")]
        private Button _CmdTimHoaDon;
        [AccessedThroughProperty("CmdTimSeri")]
        private Button _CmdTimSeri;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("GroupBox2")]
        private GroupBox _GroupBox2;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label21")]
        private Label _Label21;
        [AccessedThroughProperty("Label22")]
        private Label _Label22;
        [AccessedThroughProperty("Label23")]
        private Label _Label23;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("OptDonGiaMua")]
        private RadioButton _OptDonGiaMua;
        [AccessedThroughProperty("OptGiaVon")]
        private RadioButton _OptGiaVon;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("PNSerial")]
        private Panel _PNSerial;
        [AccessedThroughProperty("TabControl2")]
        private TabControl _TabControl2;
        [AccessedThroughProperty("TabPage2")]
        private TabPage _TabPage2;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripButton2")]
        private ToolStripButton _ToolStripButton2;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtChietKhau")]
        private C1NumericEdit _TxtChietKhau;
        [AccessedThroughProperty("TxtChietKhauNT")]
        private C1NumericEdit _TxtChietKhauNT;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("txtMST")]
        private TextBox _txtMST;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayHoaDon")]
        private DateTimePicker _TxtNgayHoaDon;
        [AccessedThroughProperty("TxtNgayXuatBan")]
        private DateTimePicker _TxtNgayXuatBan;
        [AccessedThroughProperty("TxtNguoiGiao")]
        private TextBox _TxtNguoiGiao;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoChungTuBan")]
        private TextBox _TxtSoChungTuBan;
        [AccessedThroughProperty("TxtSoHoaDon")]
        private TextBox _TxtSoHoaDon;
        [AccessedThroughProperty("TxtSoSeri")]
        private TextBox _TxtSoSeri;
        [AccessedThroughProperty("TxtSoSerial")]
        private TextBox _TxtSoSerial;
        [AccessedThroughProperty("TxtThueSuat")]
        private C1NumericEdit _TxtThueSuat;
        [AccessedThroughProperty("TxtTienHang")]
        private C1NumericEdit _TxtTienHang;
        [AccessedThroughProperty("TxtTienHangNT")]
        private C1NumericEdit _TxtTienHangNT;
        [AccessedThroughProperty("TxtTienThue")]
        private C1NumericEdit _TxtTienThue;
        [AccessedThroughProperty("TxtTienThueNT")]
        private C1NumericEdit _TxtTienThueNT;
        [AccessedThroughProperty("TxtTongThanhToan")]
        private C1NumericEdit _TxtTongThanhToan;
        [AccessedThroughProperty("TxtTongThanhToanNT")]
        private C1NumericEdit _TxtTongThanhToanNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private string cFrmFormat;
        private int cFrmGhiSo;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cfrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsDMDonViTinh objDVT;
        private clsXuatKhoChiTiet objHDCT;
        private clsDMHangHoa objHH;
        private clsDMLoaiTien ObjLT;
        private clsSoChungTu objSoCT;
        private clsNhapKho objTH;
        private clsNhapKhoChiTiet objTHCT;
        private clsXuatKho objXK;
        private DataTable pdt;

        public Frm_KhachHangTraHang()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_XuatBan_KeyDown);
            base.Load += new EventHandler(this.Frm_XuatBan_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "KHTH";
            this.objSoCT = new clsSoChungTu();
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.objHH = new clsDMHangHoa();
            this.objDVT = new clsDMDonViTinh();
            this.objTH = new clsNhapKho();
            this.ObjLT = new clsDMLoaiTien();
            this.objTHCT = new clsNhapKhoChiTiet();
            this.objHDCT = new clsXuatKhoChiTiet();
            this.objXK = new clsXuatKho();
            this.cfrmTask = "'";
            this.cFrmGhiSo = 0;
            this.InitializeComponent();
        }

        private void AdvKhachHang_ValueChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString() != "")
            {
                clsDMDoiTuong tuong = new clsDMDoiTuong();
                tuong.Load(this.AdvKhachHang.Value);
                this.txtMST.Text = tuong.MaSoThue;
            }
        }

        private void CboLoaiHoaDon_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.mEnabledControl && (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != ""))
            {
                clsDMLoaiHoaDon don = new clsDMLoaiHoaDon();
                don.Load(Conversions.ToString(this.CboLoaiHoaDon.SelectedValue));
                this.TxtThueSuat.Value = don.TyLeThue;
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
                if (strCode != "")
                {
                    this.ObjLT.LoadByCode(strCode);
                    if (this.ObjLT.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("##########", this.ObjLT.SoLe);
                    }
                    if (this.ObjLT.TienViet == 1)
                    {
                        this.txtTyGia.Enabled = false;
                    }
                    this.txtTyGia.Value = this.ObjLT.TyGia;
                    this.FormatNumber();
                }
            }
        }

        public bool CheckGrid()
        {
            if (this.VSlist.Rows.Count == 1)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập h\x00e0ng h\x00f3a trả lại!", ""));
                this.CmdAddRow.Focus();
                return false;
            }
            return true;
        }

        public bool CheckIvalid()
        {
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objTH.IsDuplicateVoucherNo(this.TxtSoChungTu.Text, this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn h\x00e3y nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập kh\x00e1ch h\x00e0ng mua h\x00e0ng!", ""));
                this.AdvKhachHang.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập tỷ gi\x00e1 nguy\x00ean tệ!", ""));
                this.txtTyGia.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.TxtDienGiai.Text, "", modGeneral.TypeOfValue.Nothing).ToString() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập diễn giải chứng từ!", ""));
                this.TxtDienGiai.Focus();
                return false;
            }
            if (!this.CheckGrid())
            {
                return false;
            }
            if (modGeneral.H_GHISODONGTHOI)
            {
                if (this.AdvTaiKhoanCo.Value.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập t\x00e0i khoản c\x00f3!", ""));
                    this.AdvTaiKhoanCo.Focus();
                    return false;
                }
                if (this.AdvTaiKhoanTraHang.Value.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập t\x00e0i khoản trả h\x00e0ng!", ""));
                    this.AdvTaiKhoanTraHang.Focus();
                    return false;
                }
                if (this.AdvTaiKhoanThue.Value.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập t\x00e0i khoản thuế!", ""));
                    this.AdvTaiKhoanThue.Focus();
                    return false;
                }
            }
            return true;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("ST_NhapTraHang", 15, "KT");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.CboLoaiTien.SelectedValue = modGeneral.H_CURRENCY;
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
            this.InitDefault();
            this.AdvTaiKhoanTraHang.SetDefault();
            this.cfrmTask = "I";
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn kh\x00e1ch h\x00e0ng trước!", ""));
                this.AdvKhachHang.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
            }
            else if (this.TxtSoChungTuBan.Text.Trim() != "")
            {
                MyProject.Forms.Frm_ChonHangTraLai.objFrmCall = this;
                MyProject.Forms.Frm_ChonHangTraLai.cFrmKhoaNhapXuat = Conversions.ToString(this.TxtSoChungTuBan.Tag);
                MyProject.Forms.Frm_ChonHangTraLai.cfrmLoai = "XK";
                MyProject.Forms.Frm_ChonHangTraLai.ShowDialog();
            }
            else
            {
                if (this.VSlist.Rows.Count == 1)
                {
                    this.VSlist.AddItem("");
                    if (LVYModule.ReturnIfNull(modGeneral.H_STOCKID, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                    {
                        clsDMKho kho = new clsDMKho();
                        kho.Load(modGeneral.H_STOCKID);
                        this.VSlist[this.VSlist.Rows.Count - 1, 1] = kho.Khoa;
                        this.VSlist[this.VSlist.Rows.Count - 1, 2] = kho.Ma;
                    }
                }
                else
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Rows.Count - 1, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        return;
                    }
                    this.VSlist.AddItem("");
                    this.VSlist[this.VSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Rows.Count - 2, 1]);
                    this.VSlist[this.VSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Rows.Count - 2, 2]);
                }
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Rows.Count - 1, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    this.VSlist.Select(this.VSlist.Rows.Count - 1, 4);
                }
                else
                {
                    this.VSlist.Select(this.VSlist.Rows.Count - 1, 2);
                }
                this.VSlist.Focus();
            }
        }

        private void CmdBoGhiSo_Click(object sender, EventArgs e)
        {
            if (this.objTH.UnRegistered(this.cFrmKhoa))
            {
                this.CmdGhiSo.Visible = true;
                this.CmdBoGhiSo.Visible = false;
                this.CmdEdit.Enabled = this.mAllowEdit;
                this.CmdDel.Enabled = this.mAllowDel;
            }
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "") && LVYModule.ConfirmDelete("")) && this.objTH.DeleteData(this.cFrmKhoa))
            {
                this.EmptyData();
                this.EnabledControl = false;
            }
        }

        private void CmdDelRow_Click(object sender, EventArgs e)
        {
            if (this.VSlist.Rows.Count != 1)
            {
                this.VSlist.RemoveItem(this.VSlist.Row);
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
                this.EnabledControl = true;
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_KhachHangTraHangList.Show();
            MyProject.Forms.Frm_KhachHangTraHangList.BringToFront();
        }

        private void CmdGhiSo_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_DinhKhoanTraHang.cFrmKhoa = this.cFrmKhoa;
            MyProject.Forms.Frm_DinhKhoanTraHang.ShowDialog();
            if (MyProject.Forms.Frm_DinhKhoanTraHang.GhiSo)
            {
                this.CmdGhiSo.Visible = false;
                this.CmdBoGhiSo.Visible = true;
                this.CmdEdit.Enabled = false;
                this.CmdDel.Enabled = false;
            }
            else
            {
                this.CmdGhiSo.Visible = true;
                this.CmdBoGhiSo.Visible = false;
                this.CmdEdit.Enabled = true & this.mAllowEdit;
                this.CmdDel.Enabled = true & this.mAllowDel;
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintNhapKho(this.cFrmKhoa);
            }
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveHHDetailsTemp())
                {
                    this.objTH.ClearTemp(this.cFrmKhoa);
                }
                else if (Conversions.ToBoolean(Microsoft.VisualBasic.CompilerServices.Operators.NotObject(this.UpdateData())))
                {
                    this.objTH.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objTH.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdTimHoaDon_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_XuatBanList.objFrmCall = this;
            MyProject.Forms.Frm_XuatBanList.ShowDialog();
        }

        private void CmdTimSeri_Click(object sender, EventArgs e)
        {
            if (this.TxtSoSerial.Text.Trim() != "")
            {
                string pKhoa = this.objXK.TimKhoaChiTietTheoSoSerial(this.TxtSoSerial.Text.Trim());
                if (pKhoa.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng t\x00ecm thấy mặt h\x00e0ng n\x00e0o c\x00f3 số serial", "") + ": " + this.TxtSoSerial.Text.Trim());
                }
                else
                {
                    clsXuatKhoChiTiet tiet = new clsXuatKhoChiTiet();
                    tiet.Load(pKhoa);
                    string khoaPhieuXuat = tiet.KhoaPhieuXuat;
                    this.InsertHoaDon(khoaPhieuXuat);
                    this.InsertDetails(pKhoa);
                }
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoaOld, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
            }
            if (this.cfrmTask == "I")
            {
                this.objSoCT.UndoVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
            }
            this.cfrmTask = "";
            this.EnabledControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtSoChungTu.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 0;
            this.TxtDienGiai.Text = "";
            this.AdvTaiKhoanCo.Value = "";
            this.AdvTaiKhoanTraHang.Value = "";
            this.AdvTaiKhoanThue.Value = "";
            this.AdvKhachHang.Value = "";
            this.VSlist.Select(0, 0);
            this.VSlist.Rows.Count = 1;
            this.TxtTienHang.Value = 0;
            this.TxtTienHangNT.Value = 0;
            this.TxtChietKhau.Value = 0;
            this.TxtChietKhauNT.Value = 0;
            this.TxtTienThue.Value = 0;
            this.TxtTienThueNT.Value = 0;
            this.TxtTongThanhToan.Value = 0;
            this.TxtTongThanhToanNT.Value = 0;
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienHangNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienHang, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTienThueNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienThue, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTongThanhToanNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtChietKhauNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtChietKhau, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTongThanhToan, modGeneral.H_FORMATNUMBER);
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Cols[14].Format = this.cFrmFormat;
            vSlist.Cols[15].Format = this.cFrmFormat;
            vSlist.Cols[0x13].Format = this.cFrmFormat;
            vSlist.Cols[0x15].Format = this.cFrmFormat;
            vSlist = null;
        }

        private void Frm_XuatBan_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode == Keys.Escape)
            {
                if (this.CmdExit.Enabled)
                {
                    this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F2)
            {
                if (this.CmdEdit.Enabled)
                {
                    this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F3)
            {
                this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (keyCode == Keys.F8)
            {
                if (this.CmdAdd.Enabled)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F9)
            {
                if (this.CmdDel.Enabled)
                {
                    this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F10)
            {
                if (this.CmdSave.Enabled)
                {
                    this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F11)
            {
                if (this.CmdUnsave.Enabled)
                {
                    this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if ((keyCode == Keys.F12) && this.CmdPrint.Enabled)
            {
                this.CmdPrint_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        private void Frm_XuatBan_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnabledControl = false;
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                BuildComboModule.BuildCombo(this.CboKhaiThue, modGeneral.ListDanhMuc.HangMucBaoCaoThue, false, " LoaiPhatSinh = 'MV' ", "");
                if (modGeneral.H_LOAIHOADONINMACDINH.Trim() == "HDBH")
                {
                    BuildComboModule.BuildCombo(this.CboLoaiHoaDon, modGeneral.ListDanhMuc.LoaiHoaDon, false, " LoaiPhatSinh = 'BR' AND Ma like '%TBR%'", "");
                }
                else
                {
                    BuildComboModule.BuildCombo(this.CboLoaiHoaDon, modGeneral.ListDanhMuc.LoaiHoaDon, false, " LoaiPhatSinh = 'BR' AND Ma like '%VBR%'", "");
                }
                C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                vSlist.Cols[6].Visible = modGeneral.H_THEODOISOLOHANG;
                vSlist.Cols[7].Visible = modGeneral.H_THEODOISERIALKHIXUAT;
                this.PNSerial.Visible = modGeneral.H_THEODOISERIALKHIXUAT;
                vSlist.Cols[9].Visible = modGeneral.H_THEODOIHANDUNG;
                vSlist = null;
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.EmptyData();
                }
                else
                {
                    this.ShowData(this.cFrmKhoa);
                }
                this.Cursor = Cursors.Default;
            }
        }

        public void InitDefault()
        {
            DefaultValue value2 = modGeneral.H_DEFAULT.Item("H_XB_LOAITHUE");
            this.AdvTaiKhoanCo.Value = modGeneral.H_DEFAULT.Item("H_XB_TKCHU").GiaTri.ToString().Trim();
            this.AdvTaiKhoanThue.Value = modGeneral.H_DEFAULT.Item("H_XB_TKTHUE").GiaTri.ToString().Trim();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_KhachHangTraHang));
            this.TxtTongThanhToan = new C1NumericEdit();
            this.Label23 = new Label();
            this.TxtTienThueNT = new C1NumericEdit();
            this.TxtTienHangNT = new C1NumericEdit();
            this.TxtChietKhauNT = new C1NumericEdit();
            this.TxtTienThue = new C1NumericEdit();
            this.TxtTienHang = new C1NumericEdit();
            this.TxtChietKhau = new C1NumericEdit();
            this.Label22 = new Label();
            this.TabControl2 = new TabControl();
            this.TabPage2 = new TabPage();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TxtTongThanhToanNT = new C1NumericEdit();
            this.Panel5 = new Panel();
            this.Label21 = new Label();
            this.Label5 = new Label();
            this.CmdTimHoaDon = new Button();
            this.Label4 = new Label();
            this.Label20 = new Label();
            this.Label16 = new Label();
            this.CboKhaiThue = new ComboBox();
            this.Label18 = new Label();
            this.GroupBox2 = new GroupBox();
            this.TxtSoHoaDon = new TextBox();
            this.Label15 = new Label();
            this.TxtSoSeri = new TextBox();
            this.Label12 = new Label();
            this.TxtNgayHoaDon = new DateTimePicker();
            this.Label14 = new Label();
            this.txtMST = new TextBox();
            this.Label8 = new Label();
            this.Label7 = new Label();
            this.TxtNgayXuatBan = new DateTimePicker();
            this.Label6 = new Label();
            this.TxtSoChungTuBan = new TextBox();
            this.TxtDienGiai = new TextBox();
            this.Label9 = new Label();
            this.TxtNguoiGiao = new TextBox();
            this.Label3 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label2 = new Label();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.Panel4 = new Panel();
            this.PNSerial = new Panel();
            this.CmdTimSeri = new Button();
            this.TxtSoSerial = new TextBox();
            this.GroupBox1 = new GroupBox();
            this.OptDonGiaMua = new RadioButton();
            this.OptGiaVon = new RadioButton();
            this.CmdDelRow = new Button();
            this.CmdAddRow = new Button();
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripButton();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.ToolStripButton2 = new ToolStripButton();
            this.CmdBoGhiSo = new ToolStripButton();
            this.CmdGhiSo = new ToolStripButton();
            this.C1DockingTab2 = new C1DockingTab();
            this.C1DockingTabPage1 = new C1DockingTabPage();
            this.C1DockingTab1 = new C1DockingTab();
            this.C1DockingTabPage2 = new C1DockingTabPage();
            this.Label17 = new Label();
            this.TxtThueSuat = new C1NumericEdit();
            this.Label19 = new Label();
            this.CboLoaiHoaDon = new ComboBox();
            this.AdvTaiKhoanCo = new ADVAccount();
            this.AdvTaiKhoanTraHang = new ADVAccount();
            this.AdvTaiKhoanThue = new ADVAccount();
            this.AdvKhachHang = new ADVObjects();
            ((ISupportInitialize) this.TxtTongThanhToan).BeginInit();
            ((ISupportInitialize) this.TxtTienThueNT).BeginInit();
            ((ISupportInitialize) this.TxtTienHangNT).BeginInit();
            ((ISupportInitialize) this.TxtChietKhauNT).BeginInit();
            ((ISupportInitialize) this.TxtTienThue).BeginInit();
            ((ISupportInitialize) this.TxtTienHang).BeginInit();
            ((ISupportInitialize) this.TxtChietKhau).BeginInit();
            this.TabControl2.SuspendLayout();
            this.VSlist.BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).BeginInit();
            this.Panel5.SuspendLayout();
            this.GroupBox2.SuspendLayout();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            this.Panel4.SuspendLayout();
            this.PNSerial.SuspendLayout();
            this.GroupBox1.SuspendLayout();
            this.ToolStrip1.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab2).BeginInit();
            this.C1DockingTab2.SuspendLayout();
            this.C1DockingTabPage1.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab1).BeginInit();
            this.C1DockingTab1.SuspendLayout();
            this.C1DockingTabPage2.SuspendLayout();
            ((ISupportInitialize) this.TxtThueSuat).BeginInit();
            this.SuspendLayout();
            this.TxtTongThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToan.DataType = typeof(double);
            this.TxtTongThanhToan.FormatType = FormatTypeEnum.Currency;
            Point point = new Point(0xc5, 0x44);
            this.TxtTongThanhToan.Location = point;
            this.TxtTongThanhToan.Name = "TxtTongThanhToan";
            Padding padding = new Padding(1);
            this.TxtTongThanhToan.Padding = padding;
            this.TxtTongThanhToan.ReadOnly = true;
            Size size = new Size(0x69, 20);
            this.TxtTongThanhToan.Size = size;
            this.TxtTongThanhToan.TabIndex = 0x88;
            this.TxtTongThanhToan.Tag = null;
            this.TxtTongThanhToan.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label23.AutoSize = true;
            this.Label23.BackColor = Color.Transparent;
            point = new Point(4, 0x47);
            this.Label23.Location = point;
            this.Label23.Name = "Label23";
            size = new Size(0x56, 13);
            this.Label23.Size = size;
            this.Label23.TabIndex = 0x87;
            this.Label23.Text = "Tổng thanh to\x00e1n";
            this.TxtTienThueNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThueNT.DataType = typeof(double);
            this.TxtTienThueNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x59, 0x2e);
            this.TxtTienThueNT.Location = point;
            this.TxtTienThueNT.Name = "TxtTienThueNT";
            padding = new Padding(1);
            this.TxtTienThueNT.Padding = padding;
            this.TxtTienThueNT.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTienThueNT.Size = size;
            this.TxtTienThueNT.TabIndex = 0x86;
            this.TxtTienThueNT.Tag = null;
            this.TxtTienThueNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienThueNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThueNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThueNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHangNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHangNT.DataType = typeof(double);
            this.TxtTienHangNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x59, 2);
            this.TxtTienHangNT.Location = point;
            this.TxtTienHangNT.Name = "TxtTienHangNT";
            padding = new Padding(1);
            this.TxtTienHangNT.Padding = padding;
            this.TxtTienHangNT.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTienHangNT.Size = size;
            this.TxtTienHangNT.TabIndex = 0x85;
            this.TxtTienHangNT.Tag = null;
            this.TxtTienHangNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHangNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienHangNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHangNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhauNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChietKhauNT.DataType = typeof(double);
            this.TxtChietKhauNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x59, 0x18);
            this.TxtChietKhauNT.Location = point;
            this.TxtChietKhauNT.Name = "TxtChietKhauNT";
            padding = new Padding(1);
            this.TxtChietKhauNT.Padding = padding;
            this.TxtChietKhauNT.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtChietKhauNT.Size = size;
            this.TxtChietKhauNT.TabIndex = 0x84;
            this.TxtChietKhauNT.Tag = null;
            this.TxtChietKhauNT.TextAlign = HorizontalAlignment.Right;
            this.TxtChietKhauNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChietKhauNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhauNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThue.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThue.DataType = typeof(double);
            this.TxtTienThue.FormatType = FormatTypeEnum.Currency;
            point = new Point(0xc5, 0x2e);
            this.TxtTienThue.Location = point;
            this.TxtTienThue.Name = "TxtTienThue";
            padding = new Padding(1);
            this.TxtTienThue.Padding = padding;
            this.TxtTienThue.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTienThue.Size = size;
            this.TxtTienThue.TabIndex = 0x83;
            this.TxtTienThue.Tag = null;
            this.TxtTienThue.TextAlign = HorizontalAlignment.Right;
            this.TxtTienThue.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThue.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThue.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHang.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHang.DataType = typeof(double);
            this.TxtTienHang.FormatType = FormatTypeEnum.Currency;
            point = new Point(0xc5, 2);
            this.TxtTienHang.Location = point;
            this.TxtTienHang.Name = "TxtTienHang";
            padding = new Padding(1);
            this.TxtTienHang.Padding = padding;
            this.TxtTienHang.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTienHang.Size = size;
            this.TxtTienHang.TabIndex = 130;
            this.TxtTienHang.Tag = null;
            this.TxtTienHang.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHang.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienHang.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHang.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhau.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChietKhau.DataType = typeof(double);
            this.TxtChietKhau.FormatType = FormatTypeEnum.Currency;
            point = new Point(0xc5, 0x18);
            this.TxtChietKhau.Location = point;
            this.TxtChietKhau.Name = "TxtChietKhau";
            padding = new Padding(1);
            this.TxtChietKhau.Padding = padding;
            this.TxtChietKhau.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtChietKhau.Size = size;
            this.TxtChietKhau.TabIndex = 0x81;
            this.TxtChietKhau.Tag = null;
            this.TxtChietKhau.TextAlign = HorizontalAlignment.Right;
            this.TxtChietKhau.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChietKhau.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhau.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label22.AutoSize = true;
            this.Label22.BackColor = Color.Transparent;
            point = new Point(4, 0x31);
            this.Label22.Location = point;
            this.Label22.Name = "Label22";
            size = new Size(0x34, 13);
            this.Label22.Size = size;
            this.Label22.TabIndex = 0x75;
            this.Label22.Text = "Tiền thuế";
            this.TabControl2.Controls.Add(this.TabPage2);
            point = new Point(0, 0x1c4);
            this.TabControl2.Location = point;
            this.TabControl2.Name = "TabControl2";
            this.TabControl2.SelectedIndex = 0;
            size = new Size(0x381, 0x3d);
            this.TabControl2.Size = size;
            this.TabControl2.TabIndex = 3;
            point = new Point(4, 0x16);
            this.TabPage2.Location = point;
            this.TabPage2.Name = "TabPage2";
            padding = new Padding(3);
            this.TabPage2.Padding = padding;
            size = new Size(0x379, 0x23);
            this.TabPage2.Size = size;
            this.TabPage2.TabIndex = 0;
            this.TabPage2.Text = "Chi tiết h\x00e0ng h\x00f3a";
            this.TabPage2.UseVisualStyleBackColor = true;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0);
            this.VSlist.Location = point;
            padding = new Padding(0);
            this.VSlist.Margin = padding;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.MinSize = 20;
            size = new Size(0x37f, 0xeb);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0;
            this.VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.TxtTongThanhToanNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToanNT.DataType = typeof(double);
            this.TxtTongThanhToanNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x59, 0x44);
            this.TxtTongThanhToanNT.Location = point;
            this.TxtTongThanhToanNT.Name = "TxtTongThanhToanNT";
            padding = new Padding(1);
            this.TxtTongThanhToanNT.Padding = padding;
            this.TxtTongThanhToanNT.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTongThanhToanNT.Size = size;
            this.TxtTongThanhToanNT.TabIndex = 0x89;
            this.TxtTongThanhToanNT.Tag = null;
            this.TxtTongThanhToanNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToanNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToanNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToanNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Panel5.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.Panel5.Controls.Add(this.TxtTongThanhToanNT);
            this.Panel5.Controls.Add(this.TxtTongThanhToan);
            this.Panel5.Controls.Add(this.Label23);
            this.Panel5.Controls.Add(this.TxtTienThueNT);
            this.Panel5.Controls.Add(this.TxtTienHangNT);
            this.Panel5.Controls.Add(this.TxtChietKhauNT);
            this.Panel5.Controls.Add(this.TxtTienThue);
            this.Panel5.Controls.Add(this.TxtTienHang);
            this.Panel5.Controls.Add(this.TxtChietKhau);
            this.Panel5.Controls.Add(this.Label22);
            this.Panel5.Controls.Add(this.Label21);
            this.Panel5.Controls.Add(this.Label5);
            this.Panel5.Dock = DockStyle.Right;
            point = new Point(590, 0);
            this.Panel5.Location = point;
            this.Panel5.Name = "Panel5";
            size = new Size(0x133, 0x5b);
            this.Panel5.Size = size;
            this.Panel5.TabIndex = 0;
            this.Label21.AutoSize = true;
            this.Label21.BackColor = Color.Transparent;
            point = new Point(4, 0x1c);
            this.Label21.Location = point;
            this.Label21.Name = "Label21";
            size = new Size(0x51, 13);
            this.Label21.Size = size;
            this.Label21.TabIndex = 0x74;
            this.Label21.Text = "Tiền chiết khấu";
            this.Label5.AutoSize = true;
            this.Label5.BackColor = Color.Transparent;
            point = new Point(4, 6);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x37, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x73;
            this.Label5.Text = "Tiền h\x00e0ng";
            this.CmdTimHoaDon.FlatStyle = FlatStyle.System;
            point = new Point(0xc3, 13);
            this.CmdTimHoaDon.Location = point;
            this.CmdTimHoaDon.Name = "CmdTimHoaDon";
            size = new Size(0x16, 0x16);
            this.CmdTimHoaDon.Size = size;
            this.CmdTimHoaDon.TabIndex = 2;
            this.CmdTimHoaDon.Text = "...";
            this.CmdTimHoaDon.UseVisualStyleBackColor = true;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new Point(0xf6, 0x11);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x20, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x63;
            this.Label4.Text = "Ng\x00e0y";
            this.Label20.AutoSize = true;
            this.Label20.BackColor = Color.Transparent;
            point = new Point(0x19e, 0x9d);
            this.Label20.Location = point;
            this.Label20.Name = "Label20";
            size = new Size(0x4f, 13);
            this.Label20.Size = size;
            this.Label20.TabIndex = 0x12;
            this.Label20.Text = "T\x00e0i khoản thuế";
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            this.Label16.BackColor = Color.Transparent;
            point = new Point(0x10, 0x56);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x41, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0x70;
            this.Label16.Text = "Kh\x00e1ch h\x00e0ng";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.CboKhaiThue.FormattingEnabled = true;
            point = new Point(0x206, 0x54);
            this.CboKhaiThue.Location = point;
            this.CboKhaiThue.Name = "CboKhaiThue";
            size = new Size(0x147, 0x15);
            this.CboKhaiThue.Size = size;
            this.CboKhaiThue.TabIndex = 13;
            this.Label18.AutoSize = true;
            this.Label18.BackColor = Color.Transparent;
            point = new Point(0x19d, 0x57);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(0x34, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 12;
            this.Label18.Text = "Khai thuế";
            this.GroupBox2.BackColor = Color.Transparent;
            this.GroupBox2.Controls.Add(this.TxtSoHoaDon);
            this.GroupBox2.Controls.Add(this.Label15);
            this.GroupBox2.Controls.Add(this.TxtSoSeri);
            this.GroupBox2.Controls.Add(this.Label12);
            this.GroupBox2.Controls.Add(this.TxtNgayHoaDon);
            this.GroupBox2.Controls.Add(this.Label14);
            point = new Point(0x198, 9);
            this.GroupBox2.Location = point;
            this.GroupBox2.Name = "GroupBox2";
            size = new Size(440, 0x2c);
            this.GroupBox2.Size = size;
            this.GroupBox2.TabIndex = 0x7e;
            this.GroupBox2.TabStop = false;
            point = new Point(110, 0x10);
            this.TxtSoHoaDon.Location = point;
            this.TxtSoHoaDon.Name = "TxtSoHoaDon";
            size = new Size(0x51, 20);
            this.TxtSoHoaDon.Size = size;
            this.TxtSoHoaDon.TabIndex = 1;
            this.Label15.AutoSize = true;
            point = new Point(0xc7, 0x13);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            size = new Size(0x27, 13);
            this.Label15.Size = size;
            this.Label15.TabIndex = 2;
            this.Label15.Text = "Số seri";
            point = new Point(0xf4, 15);
            this.TxtSoSeri.Location = point;
            this.TxtSoSeri.Name = "TxtSoSeri";
            size = new Size(0x48, 20);
            this.TxtSoSeri.Size = size;
            this.TxtSoSeri.TabIndex = 3;
            this.Label12.AutoSize = true;
            point = new Point(320, 0x12);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            size = new Size(0x20, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 4;
            this.Label12.Text = "Ng\x00e0y";
            this.TxtNgayHoaDon.Format = DateTimePickerFormat.Custom;
            point = new Point(0x161, 15);
            this.TxtNgayHoaDon.Location = point;
            this.TxtNgayHoaDon.Name = "TxtNgayHoaDon";
            size = new Size(0x54, 20);
            this.TxtNgayHoaDon.Size = size;
            this.TxtNgayHoaDon.TabIndex = 5;
            this.Label14.AutoSize = true;
            point = new Point(9, 0x11);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            size = new Size(0x3f, 13);
            this.Label14.Size = size;
            this.Label14.TabIndex = 0;
            this.Label14.Text = "Số h\x00f3a đơn";
            point = new Point(0x6c, 0x6a);
            this.txtMST.Location = point;
            this.txtMST.Name = "txtMST";
            size = new Size(290, 20);
            this.txtMST.Size = size;
            this.txtMST.TabIndex = 9;
            this.Label8.AutoEllipsis = true;
            this.Label8.AutoSize = true;
            this.Label8.BackColor = Color.Transparent;
            point = new Point(0x10, 0x6d);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            this.Label8.RightToLeft = RightToLeft.No;
            size = new Size(30, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x75;
            this.Label8.Text = "MST";
            this.Label8.TextAlign = ContentAlignment.TopRight;
            this.Label7.AutoSize = true;
            this.Label7.BackColor = Color.Transparent;
            point = new Point(0x19d, 0x86);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x61, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x10;
            this.Label7.Text = "T\x00e0i khoản trả h\x00e0ng";
            this.TxtNgayXuatBan.Enabled = false;
            this.TxtNgayXuatBan.Format = DateTimePickerFormat.Custom;
            point = new Point(0x12b, 14);
            this.TxtNgayXuatBan.Location = point;
            this.TxtNgayXuatBan.Name = "TxtNgayXuatBan";
            size = new Size(0x63, 20);
            this.TxtNgayXuatBan.Size = size;
            this.TxtNgayXuatBan.TabIndex = 3;
            this.Label6.AutoSize = true;
            this.Label6.BackColor = Color.Transparent;
            point = new Point(0x10, 0x11);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x4e, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x61;
            this.Label6.Text = "Phiếu xuất b\x00e1n";
            point = new Point(0x6c, 14);
            this.TxtSoChungTuBan.Location = point;
            this.TxtSoChungTuBan.Name = "TxtSoChungTuBan";
            this.TxtSoChungTuBan.ReadOnly = true;
            size = new Size(0x57, 20);
            this.TxtSoChungTuBan.Size = size;
            this.TxtSoChungTuBan.TabIndex = 0;
            point = new Point(0x6c, 0x9b);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(290, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 11;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            this.Label9.BackColor = Color.Transparent;
            point = new Point(15, 0x9c);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x30, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x5f;
            this.Label9.Text = "Diễn giải";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x6c, 0x81);
            this.TxtNguoiGiao.Location = point;
            this.TxtNguoiGiao.Name = "TxtNguoiGiao";
            size = new Size(290, 20);
            this.TxtNguoiGiao.Size = size;
            this.TxtNguoiGiao.TabIndex = 10;
            this.Label3.AutoEllipsis = true;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new Point(0x10, 0x84);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            this.Label3.RightToLeft = RightToLeft.No;
            size = new Size(0x3a, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x5d;
            this.Label3.Text = "Người giao";
            this.Label3.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiTien.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x6c, 60);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x6c, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 6;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x12b, 60);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            padding = new Padding(1);
            this.txtTyGia.Padding = padding;
            size = new Size(0x63, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 7;
            this.txtTyGia.Tag = null;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.txtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.txtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label11.AutoSize = true;
            this.Label11.BackColor = Color.Transparent;
            point = new Point(0x10, 0x3f);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 0x39;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            this.Label10.BackColor = Color.Transparent;
            point = new Point(0xf2, 0x3f);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 0x38;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(0x19e, 0x6f);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(70, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 14;
            this.Label2.Text = "T\x00e0i khoản c\x00f3";
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new Point(0xf6, 40);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x23;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Custom;
            point = new Point(0x12b, 0x25);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x63, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 5;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(0x10, 40);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x21;
            this.Label1.Text = "Số chứng từ";
            point = new Point(0x6c, 0x25);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x6c, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 4;
            this.Panel4.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.Panel4.Controls.Add(this.PNSerial);
            this.Panel4.Controls.Add(this.GroupBox1);
            this.Panel4.Controls.Add(this.CmdDelRow);
            this.Panel4.Controls.Add(this.CmdAddRow);
            this.Panel4.Controls.Add(this.Panel5);
            this.Panel4.Dock = DockStyle.Bottom;
            point = new Point(0, 0x201);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x381, 0x5b);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 4;
            this.PNSerial.BackColor = Color.Transparent;
            this.PNSerial.Controls.Add(this.CmdTimSeri);
            this.PNSerial.Controls.Add(this.TxtSoSerial);
            point = new Point(0xb9, 3);
            this.PNSerial.Location = point;
            this.PNSerial.Name = "PNSerial";
            size = new Size(0xa2, 30);
            this.PNSerial.Size = size;
            this.PNSerial.TabIndex = 0x12;
            this.CmdTimSeri.Image = ACCOUNTING.My.Resources.Resources.view;
            point = new Point(0x80, 1);
            this.CmdTimSeri.Location = point;
            this.CmdTimSeri.Name = "CmdTimSeri";
            size = new Size(0x19, 0x19);
            this.CmdTimSeri.Size = size;
            this.CmdTimSeri.TabIndex = 1;
            this.CmdTimSeri.UseVisualStyleBackColor = true;
            this.TxtSoSerial.Font = new Font("Microsoft Sans Serif", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
            point = new Point(4, 2);
            this.TxtSoSerial.Location = point;
            this.TxtSoSerial.Name = "TxtSoSerial";
            size = new Size(0x7b, 0x17);
            this.TxtSoSerial.Size = size;
            this.TxtSoSerial.TabIndex = 0;
            this.GroupBox1.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.GroupBox1.Controls.Add(this.OptDonGiaMua);
            this.GroupBox1.Controls.Add(this.OptGiaVon);
            point = new Point(0xe3, 0x2c);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            size = new Size(0x157, 0x2c);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 2;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "T\x00ednh gi\x00e1 vốn";
            this.OptDonGiaMua.AutoSize = true;
            this.OptDonGiaMua.BackColor = Color.Transparent;
            this.OptDonGiaMua.Checked = true;
            point = new Point(0xa7, 20);
            this.OptDonGiaMua.Location = point;
            this.OptDonGiaMua.Name = "OptDonGiaMua";
            size = new Size(0x55, 0x11);
            this.OptDonGiaMua.Size = size;
            this.OptDonGiaMua.TabIndex = 1;
            this.OptDonGiaMua.TabStop = true;
            this.OptDonGiaMua.Text = "Đơn gi\x00e1 mua";
            this.OptDonGiaMua.UseVisualStyleBackColor = false;
            this.OptGiaVon.AutoSize = true;
            this.OptGiaVon.BackColor = Color.Transparent;
            point = new Point(40, 20);
            this.OptGiaVon.Location = point;
            this.OptGiaVon.Name = "OptGiaVon";
            size = new Size(0x63, 0x11);
            this.OptGiaVon.Size = size;
            this.OptGiaVon.TabIndex = 0;
            this.OptGiaVon.TabStop = true;
            this.OptGiaVon.Text = "Gi\x00e1 vốn hiện tại";
            this.OptGiaVon.UseVisualStyleBackColor = false;
            this.CmdDelRow.Image = (Image) manager.GetObject("CmdDelRow.Image");
            this.CmdDelRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x62, 3);
            this.CmdDelRow.Location = point;
            this.CmdDelRow.Name = "CmdDelRow";
            size = new Size(0x54, 0x19);
            this.CmdDelRow.Size = size;
            this.CmdDelRow.TabIndex = 1;
            this.CmdDelRow.Text = "&2.X\x00f3a d\x00f2ng";
            this.CmdDelRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdDelRow.UseVisualStyleBackColor = true;
            this.CmdAddRow.Image = (Image) manager.GetObject("CmdAddRow.Image");
            this.CmdAddRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(3, 3);
            this.CmdAddRow.Location = point;
            this.CmdAddRow.Name = "CmdAddRow";
            size = new Size(0x5c, 0x19);
            this.CmdAddRow.Size = size;
            this.CmdAddRow.TabIndex = 0;
            this.CmdAddRow.Text = "&1.Th\x00eam d\x00f2ng";
            this.CmdAddRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdAddRow.UseVisualStyleBackColor = true;
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.ToolStripButton2, this.CmdBoGhiSo, this.CmdGhiSo });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x381, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x4d, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x25, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.ToolStripButton2.Alignment = ToolStripItemAlignment.Right;
            this.ToolStripButton2.Image = (Image) manager.GetObject("ToolStripButton2.Image");
            this.ToolStripButton2.ImageScaling = ToolStripItemImageScaling.None;
            this.ToolStripButton2.ImageTransparentColor = Color.White;
            this.ToolStripButton2.Name = "ToolStripButton2";
            size = new Size(0x35, 0x16);
            this.ToolStripButton2.Size = size;
            this.ToolStripButton2.Text = "&Help";
            this.CmdBoGhiSo.Image = (Image) manager.GetObject("CmdBoGhiSo.Image");
            this.CmdBoGhiSo.ImageTransparentColor = Color.Magenta;
            this.CmdBoGhiSo.Name = "CmdBoGhiSo";
            size = new Size(0x54, 0x16);
            this.CmdBoGhiSo.Size = size;
            this.CmdBoGhiSo.Text = "Huỷ ghi sổ";
            this.CmdBoGhiSo.Visible = false;
            this.CmdGhiSo.Image = (Image) manager.GetObject("CmdGhiSo.Image");
            this.CmdGhiSo.ImageTransparentColor = Color.White;
            this.CmdGhiSo.Name = "CmdGhiSo";
            size = new Size(60, 0x16);
            this.CmdGhiSo.Size = size;
            this.CmdGhiSo.Text = "Ghi sổ";
            this.CmdGhiSo.Visible = false;
            this.C1DockingTab2.Controls.Add(this.C1DockingTabPage1);
            this.C1DockingTab2.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.C1DockingTab2.Location = point;
            this.C1DockingTab2.Name = "C1DockingTab2";
            this.C1DockingTab2.SelectedIndex = 1;
            size = new Size(0x381, 0xe3);
            this.C1DockingTab2.Size = size;
            this.C1DockingTab2.TabIndex = 1;
            this.C1DockingTab2.TabsSpacing = 5;
            this.C1DockingTab2.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab2.VisualStyle = C1.Win.C1Command.VisualStyle.Custom;
            this.C1DockingTab2.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage1.Controls.Add(this.Label17);
            this.C1DockingTabPage1.Controls.Add(this.TxtThueSuat);
            this.C1DockingTabPage1.Controls.Add(this.Label19);
            this.C1DockingTabPage1.Controls.Add(this.CboLoaiHoaDon);
            this.C1DockingTabPage1.Controls.Add(this.CboKhaiThue);
            this.C1DockingTabPage1.Controls.Add(this.Label6);
            this.C1DockingTabPage1.Controls.Add(this.Label18);
            this.C1DockingTabPage1.Controls.Add(this.TxtSoChungTu);
            this.C1DockingTabPage1.Controls.Add(this.GroupBox2);
            this.C1DockingTabPage1.Controls.Add(this.Label1);
            this.C1DockingTabPage1.Controls.Add(this.TxtNgayChungTu);
            this.C1DockingTabPage1.Controls.Add(this.txtMST);
            this.C1DockingTabPage1.Controls.Add(this.Label13);
            this.C1DockingTabPage1.Controls.Add(this.Label8);
            this.C1DockingTabPage1.Controls.Add(this.AdvTaiKhoanCo);
            this.C1DockingTabPage1.Controls.Add(this.Label7);
            this.C1DockingTabPage1.Controls.Add(this.Label2);
            this.C1DockingTabPage1.Controls.Add(this.AdvTaiKhoanTraHang);
            this.C1DockingTabPage1.Controls.Add(this.Label10);
            this.C1DockingTabPage1.Controls.Add(this.Label20);
            this.C1DockingTabPage1.Controls.Add(this.Label11);
            this.C1DockingTabPage1.Controls.Add(this.AdvTaiKhoanThue);
            this.C1DockingTabPage1.Controls.Add(this.txtTyGia);
            this.C1DockingTabPage1.Controls.Add(this.Label16);
            this.C1DockingTabPage1.Controls.Add(this.CboLoaiTien);
            this.C1DockingTabPage1.Controls.Add(this.AdvKhachHang);
            this.C1DockingTabPage1.Controls.Add(this.Label3);
            this.C1DockingTabPage1.Controls.Add(this.CmdTimHoaDon);
            this.C1DockingTabPage1.Controls.Add(this.TxtNguoiGiao);
            this.C1DockingTabPage1.Controls.Add(this.Label4);
            this.C1DockingTabPage1.Controls.Add(this.Label9);
            this.C1DockingTabPage1.Controls.Add(this.TxtNgayXuatBan);
            this.C1DockingTabPage1.Controls.Add(this.TxtDienGiai);
            this.C1DockingTabPage1.Controls.Add(this.TxtSoChungTuBan);
            this.C1DockingTabPage1.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage1.Location = point;
            this.C1DockingTabPage1.Name = "C1DockingTabPage1";
            size = new Size(0x37f, 0xc9);
            this.C1DockingTabPage1.Size = size;
            this.C1DockingTabPage1.TabIndex = 0;
            this.C1DockingTabPage1.Text = "Th\x00f4ng tin phiếu trả h\x00e0ng";
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage2);
            this.C1DockingTab1.Dock = DockStyle.Fill;
            point = new Point(0, 0xfc);
            this.C1DockingTab1.Location = point;
            this.C1DockingTab1.Name = "C1DockingTab1";
            this.C1DockingTab1.SelectedIndex = 1;
            size = new Size(0x381, 0x105);
            this.C1DockingTab1.Size = size;
            this.C1DockingTab1.TabIndex = 2;
            this.C1DockingTab1.TabsSpacing = 5;
            this.C1DockingTab1.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab1.VisualStyle = C1.Win.C1Command.VisualStyle.Custom;
            this.C1DockingTab1.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage2.Controls.Add(this.VSlist);
            this.C1DockingTabPage2.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage2.Location = point;
            this.C1DockingTabPage2.Name = "C1DockingTabPage2";
            size = new Size(0x37f, 0xeb);
            this.C1DockingTabPage2.Size = size;
            this.C1DockingTabPage2.TabIndex = 0;
            this.C1DockingTabPage2.Text = "Chi tiết h\x00e0ng h\x00f3a";
            this.Label17.AutoSize = true;
            this.Label17.BackColor = Color.Transparent;
            point = new Point(0x289, 0x3e);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            size = new Size(0x37, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 0x94;
            this.Label17.Text = "Thuế suất";
            this.Label17.TextAlign = ContentAlignment.TopRight;
            this.TxtThueSuat.BorderStyle = BorderStyle.FixedSingle;
            this.TxtThueSuat.DataType = typeof(short);
            this.TxtThueSuat.FormatType = FormatTypeEnum.Integer;
            point = new Point(0x2ca, 0x3b);
            this.TxtThueSuat.Location = point;
            this.TxtThueSuat.Name = "TxtThueSuat";
            padding = new Padding(1);
            this.TxtThueSuat.Padding = padding;
            this.TxtThueSuat.ReadOnly = true;
            size = new Size(0x83, 20);
            this.TxtThueSuat.Size = size;
            this.TxtThueSuat.TabIndex = 0x93;
            this.TxtThueSuat.Tag = null;
            this.TxtThueSuat.Value = (short) 0;
            this.TxtThueSuat.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtThueSuat.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtThueSuat.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label19.AutoSize = true;
            this.Label19.BackColor = Color.Transparent;
            point = new Point(0x1a1, 60);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            size = new Size(70, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 0x92;
            this.Label19.Text = "Loại h\x00f3a đơn";
            this.Label19.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiHoaDon.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiHoaDon.FormattingEnabled = true;
            point = new Point(0x206, 0x3a);
            this.CboLoaiHoaDon.Location = point;
            this.CboLoaiHoaDon.Name = "CboLoaiHoaDon";
            size = new Size(0x7a, 0x15);
            this.CboLoaiHoaDon.Size = size;
            this.CboLoaiHoaDon.TabIndex = 0x91;
            this.AdvTaiKhoanCo.Conditions = "";
            this.AdvTaiKhoanCo.DefaultValue = "";
            this.AdvTaiKhoanCo.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoanCo.KeyFilter = "111|112|131";
            point = new Point(0x206, 0x6c);
            this.AdvTaiKhoanCo.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanCo.Margin = padding;
            this.AdvTaiKhoanCo.Name = "AdvTaiKhoanCo";
            this.AdvTaiKhoanCo.OnlyDigit = false;
            this.AdvTaiKhoanCo.ReadOnly = false;
            size = new Size(0x147, 20);
            this.AdvTaiKhoanCo.Size = size;
            this.AdvTaiKhoanCo.TabIndex = 15;
            this.AdvTaiKhoanCo.UpperText = true;
            this.AdvTaiKhoanCo.Value = "";
            this.AdvTaiKhoanCo.WithCode = 80;
            this.AdvTaiKhoanTraHang.Conditions = "";
            this.AdvTaiKhoanTraHang.DefaultValue = "531";
            this.AdvTaiKhoanTraHang.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoanTraHang.KeyFilter = "531";
            point = new Point(0x206, 0x84);
            this.AdvTaiKhoanTraHang.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanTraHang.Margin = padding;
            this.AdvTaiKhoanTraHang.Name = "AdvTaiKhoanTraHang";
            this.AdvTaiKhoanTraHang.OnlyDigit = false;
            this.AdvTaiKhoanTraHang.ReadOnly = false;
            size = new Size(0x147, 20);
            this.AdvTaiKhoanTraHang.Size = size;
            this.AdvTaiKhoanTraHang.TabIndex = 0x11;
            this.AdvTaiKhoanTraHang.UpperText = true;
            this.AdvTaiKhoanTraHang.Value = "";
            this.AdvTaiKhoanTraHang.WithCode = 80;
            this.AdvTaiKhoanThue.Conditions = "";
            this.AdvTaiKhoanThue.DefaultValue = "";
            this.AdvTaiKhoanThue.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoanThue.KeyFilter = "333";
            point = new Point(0x206, 0x9b);
            this.AdvTaiKhoanThue.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanThue.Margin = padding;
            this.AdvTaiKhoanThue.Name = "AdvTaiKhoanThue";
            this.AdvTaiKhoanThue.OnlyDigit = false;
            this.AdvTaiKhoanThue.ReadOnly = false;
            size = new Size(0x147, 20);
            this.AdvTaiKhoanThue.Size = size;
            this.AdvTaiKhoanThue.TabIndex = 0x13;
            this.AdvTaiKhoanThue.UpperText = true;
            this.AdvTaiKhoanThue.Value = "";
            this.AdvTaiKhoanThue.WithCode = 80;
            this.AdvKhachHang.Conditions = "";
            this.AdvKhachHang.LoaiDoiTuong = modGeneral.TypeObjects.KhachHang;
            point = new Point(0x6c, 0x54);
            this.AdvKhachHang.Location = point;
            this.AdvKhachHang.Name = "AdvKhachHang";
            this.AdvKhachHang.ReadOnly = false;
            size = new Size(290, 20);
            this.AdvKhachHang.Size = size;
            this.AdvKhachHang.TabIndex = 8;
            this.AdvKhachHang.UpperText = true;
            this.AdvKhachHang.Value = "";
            this.AdvKhachHang.WidthCode = 80;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x381, 0x25c);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.C1DockingTab1);
            this.Controls.Add(this.C1DockingTab2);
            this.Controls.Add(this.TabControl2);
            this.Controls.Add(this.ToolStrip1);
            this.Controls.Add(this.Panel4);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.KeyPreview = true;
            this.Name = "Frm_KhachHangTraHang";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BH-0004";
            this.Text = "HANG BAN BI TRA LAI";
            ((ISupportInitialize) this.TxtTongThanhToan).EndInit();
            ((ISupportInitialize) this.TxtTienThueNT).EndInit();
            ((ISupportInitialize) this.TxtTienHangNT).EndInit();
            ((ISupportInitialize) this.TxtChietKhauNT).EndInit();
            ((ISupportInitialize) this.TxtTienThue).EndInit();
            ((ISupportInitialize) this.TxtTienHang).EndInit();
            ((ISupportInitialize) this.TxtChietKhau).EndInit();
            this.TabControl2.ResumeLayout(false);
            this.VSlist.EndInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).EndInit();
            this.Panel5.ResumeLayout(false);
            this.Panel5.PerformLayout();
            this.GroupBox2.ResumeLayout(false);
            this.GroupBox2.PerformLayout();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            this.Panel4.ResumeLayout(false);
            this.PNSerial.ResumeLayout(false);
            this.PNSerial.PerformLayout();
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            ((ISupportInitialize) this.C1DockingTab2).EndInit();
            this.C1DockingTab2.ResumeLayout(false);
            this.C1DockingTabPage1.ResumeLayout(false);
            this.C1DockingTabPage1.PerformLayout();
            ((ISupportInitialize) this.C1DockingTab1).EndInit();
            this.C1DockingTab1.ResumeLayout(false);
            this.C1DockingTabPage2.ResumeLayout(false);
            ((ISupportInitialize) this.TxtThueSuat).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void InsertDetails(string pKhoa)
        {
            int num = 0;
            clsXuatKhoChiTiet tiet = new clsXuatKhoChiTiet();
            if (!this.SearchDetail(pKhoa))
            {
                DataTable table = tiet.LoadDetails(pKhoa);
                if (table != null)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    int num2 = vSlist.Cols.Count - 1;
                    for (num = 0; num <= num2; num++)
                    {
                        vSlist[vSlist.Rows.Count - 1, num] = RuntimeHelpers.GetObjectValue(table.Rows[0][num]);
                    }
                    vSlist[vSlist.Rows.Count - 1, 9] = LVYModule.Char2Date(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[vSlist.Rows.Count - 1, 9]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    vSlist = null;
                    this.TinhTong();
                }
            }
        }

        public void InsertHoaDon(string strKhoa)
        {
            clsXuatKho kho = new clsXuatKho();
            kho.Load(strKhoa);
            this.TxtSoChungTuBan.Tag = kho.Khoa;
            this.TxtSoChungTuBan.Text = kho.SoChungTu;
            this.AdvKhachHang.Value = kho.KhoaDoiTuong;
            this.TxtNgayXuatBan.Text = LVYModule.Char2Date(kho.NgayChungTu);
            this.AdvTaiKhoanCo.Value = kho.KhoaTKThanhToan;
            this.AdvTaiKhoanThue.Value = kho.KhoaTKThue;
            this.CboLoaiTien.SelectedValue = kho.LoaiTien;
            this.txtTyGia.Value = kho.TyGia;
            this.CboLoaiTien.Enabled = false;
            this.AdvKhachHang.ReadOnly = true;
        }

        public void LoadDetailsHangHoa(string pKhoa)
        {
            DataTable detailsTraHang = this.objTH.GetDetailsTraHang(pKhoa);
            if (detailsTraHang != null)
            {
                this.VSlist.Rows.Count = 1;
                int num2 = detailsTraHang.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaKho"]);
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoHang"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["Ma"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["HangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["SoLoHang"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["SoSeri"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["NgayNhap"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = LVYModule.Char2Date(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["HanSuDung"]), "", modGeneral.TypeOfValue.Nothing)));
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaDonViTinh"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["DonViTinh"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["QuyCach"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["SoLuong"]);
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["GiaBanNT"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TienBanNT"]);
                    vSlist[vSlist.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["DonGiaNT"]);
                    vSlist[vSlist.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TienHangNT"]);
                    vSlist[vSlist.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TyLeChietKhau"]);
                    vSlist[vSlist.Rows.Count - 1, 0x13] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TienChietKhauNT"]);
                    vSlist[vSlist.Rows.Count - 1, 20] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TyLeThue"]);
                    vSlist[vSlist.Rows.Count - 1, 0x15] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TienThueNT"]);
                    vSlist[vSlist.Rows.Count - 1, 0x16] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaTKHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 0x17] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TaiKhoanHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 0x18] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaTKGiaVon"]);
                    vSlist[vSlist.Rows.Count - 1, 0x19] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TaiKhoanGiaVon"]);
                    vSlist = null;
                }
            }
        }

        public bool SaveHHDetailsTemp()
        {
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            clsNhapKhoChiTiet objTHCT = this.objTHCT;
            int num3 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num3; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        this.VSlist[i, 0] = modGeneral.CreatKey("ST_NhapKhoChiTiet", 15, "NK");
                    }
                    objTHCT.Khoa = this.VSlist[i, 0].ToString().Trim();
                    objTHCT.KhoaPhieuNhap = this.cFrmKhoa;
                    objTHCT.KhoaHangHoa = this.VSlist[i, 3].ToString().Trim();
                    objTHCT.KhoaKho = this.VSlist[i, 1].ToString().Trim();
                    objTHCT.SoLoHang = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 6]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objTHCT.NgayNhap = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
                    objTHCT.NgayHetHanDung = LVYModule.Date2Char(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 9]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    objTHCT.SoSeri = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 7]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objTHCT.SoLuong = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 13]), 0, modGeneral.TypeOfValue.Nothing));
                    objTHCT.GiaBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 14]), 0, modGeneral.TypeOfValue.Nothing));
                    objTHCT.GiaBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 14]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objTHCT.TienBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                    objTHCT.TienBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 15]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    if (this.TxtSoChungTuBan.Text.Trim() != "")
                    {
                        objTHCT.DonGiaNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
                        objTHCT.DonGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
                        objTHCT.TienHangNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
                        objTHCT.TienHang = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
                    }
                    else
                    {
                        objTHCT.DonGiaNT = objTHCT.GiaBanNT;
                        objTHCT.DonGia = objTHCT.GiaBanNT * num2;
                        objTHCT.TienHangNT = objTHCT.TienBanNT;
                        objTHCT.TienHang = objTHCT.TienBanNT * num2;
                    }
                    objTHCT.TyLeThue = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 20]), 0, modGeneral.TypeOfValue.Nothing));
                    objTHCT.TienThueNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x15]), 0, modGeneral.TypeOfValue.Nothing));
                    objTHCT.TienThue = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x15]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objTHCT.TyLeChietKhau = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
                    objTHCT.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
                    objTHCT.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x13]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objTHCT.KhoaDonViTinh = this.VSlist[i, 10].ToString().Trim();
                    objTHCT.HeSo = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                    objTHCT.KhoaTKHangHoa = this.VSlist[i, 0x16].ToString().Trim();
                    objTHCT.KhoaTKGiaVon = this.VSlist[i, 0x18].ToString().Trim();
                    if (!objTHCT.Save())
                    {
                        return false;
                    }
                }
            }
            objTHCT = null;
            return true;
        }

        public bool SearchDetail(string pKhoa)
        {
            int num2 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == pKhoa.Trim())
                {
                    return true;
                }
            }
            return false;
        }

        public void ShowData(string pKhoa)
        {
            if (this.objTH.Load(pKhoa))
            {
                clsNhapKho objTH = this.objTH;
                this.cFrmKhoa = objTH.Khoa;
                this.TxtSoChungTuBan.Tag = objTH.KhoaDonHang;
                this.TxtSoChungTuBan.Text = objTH.SoDonHang;
                this.TxtNgayXuatBan.Text = LVYModule.Char2Date(objTH.NgayDonHang);
                this.TxtSoChungTu.Text = objTH.SoChungTu;
                this.TxtNgayChungTu.Text = LVYModule.Char2Date(objTH.NgayChungTu);
                this.AdvKhachHang.Value = objTH.KhoaDoiTuong;
                this.CboLoaiTien.SelectedValue = objTH.LoaiTien;
                this.txtTyGia.Value = objTH.TyGia;
                this.TxtTienHangNT.Value = objTH.TienHangNT;
                this.TxtTienHang.Value = objTH.TienHang;
                this.TxtChietKhauNT.Value = objTH.TienChietKhauNT;
                this.TxtChietKhau.Value = objTH.TienChietKhau;
                this.TxtTienThueNT.Value = objTH.TienThueVATNT;
                this.TxtTienThue.Value = objTH.TienThueVAT;
                this.TxtTongThanhToanNT.Value = (objTH.TienHangNT - objTH.TienChietKhauNT) + objTH.TienThueVATNT;
                this.TxtTongThanhToan.Value = (objTH.TienHang - objTH.TienChietKhau) + objTH.TienThueVAT;
                this.AdvTaiKhoanCo.Value = objTH.KhoaTKThanhToan;
                this.AdvTaiKhoanThue.Value = objTH.KhoaTKNoThueVAT;
                this.AdvTaiKhoanTraHang.Value = objTH.KhoaTKCoThueVAT;
                this.TxtDienGiai.Text = objTH.DienGiai;
                this.cFrmGhiSo = objTH.GhiSo;
                this.CboKhaiThue.SelectedValue = objTH.KhoaHangMucBaoCaoThue;
                this.TxtSoHoaDon.Text = objTH.SoHoaDon;
                this.TxtSoSeri.Text = objTH.SoSeri;
                this.TxtNgayHoaDon.Text = LVYModule.Char2Date(objTH.NgayHoaDon);
                this.txtMST.Text = objTH.MaSoThue;
                this.CboLoaiHoaDon.SelectedValue = RuntimeHelpers.GetObjectValue(LVYModule.ReturnIfNull(objTH.KhoaLoaiHoaDon, "", modGeneral.TypeOfValue.Nothing));
                this.TxtThueSuat.Value = RuntimeHelpers.GetObjectValue(LVYModule.ReturnIfNull(objTH.ThueSuat, 0, modGeneral.TypeOfValue.Nothing));
                this.LoadDetailsHangHoa(this.cFrmKhoa);
                objTH = null;
            }
        }

        public void TinhChietKhau(int nRow)
        {
            double num = 0.0;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 15]), 0, modGeneral.TypeOfValue.Nothing));
            int num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 0x13] = Math.Round((double) ((num * num2) / 100.0), 0);
        }

        private void TinhThue(int nRow)
        {
            double num = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            int num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 20]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 15]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
            vSlist[nRow, 0x15] = Math.Round((double) ((num2 * num) / 100.0), 0);
            vSlist = null;
        }

        public void TinhTienBan(int nRow)
        {
            double num = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 14]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            vSlist[nRow, 15] = num * num2;
            vSlist = null;
        }

        public void TinhTienVon(int nRow)
        {
            double num = 0.0;
            double num3 = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
            num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 12]), 1, modGeneral.TypeOfValue.Nothing));
            vSlist[nRow, 0x11] = (num * num3) * num2;
            vSlist = null;
        }

        public void TinhTong()
        {
            double num = 0.0;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTienHangNT.Value = LVYModule.SumColGrid(this.VSlist, 15);
            this.TxtChietKhauNT.Value = LVYModule.SumColGrid(this.VSlist, 0x13);
            this.TxtTienThueNT.Value = LVYModule.SumColGrid(this.VSlist, 0x15);
            this.TxtTongThanhToanNT.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTienHang.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
            this.TxtChietKhau.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
            this.TxtTienThue.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
            this.TxtTongThanhToan.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
        }

        public object UpdateData()
        {
            object obj2;
            clsNhapKho objTH = this.objTH;
            objTH.Khoa = this.cFrmKhoa;
            objTH.KhoaDonHang = Conversions.ToString(this.TxtSoChungTuBan.Tag);
            objTH.SoDonHang = this.TxtSoChungTuBan.Text.ToString().Trim();
            objTH.NgayDonHang = LVYModule.Date2Char(this.TxtNgayXuatBan.Text.ToString().Trim());
            objTH.SoChungTu = this.TxtSoChungTu.Text.Trim();
            objTH.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objTH.KhoaDoiTuong = this.AdvKhachHang.Value;
            objTH.NguoiGiao = "";
            objTH.KhoaBoPhan = "";
            objTH.KhoaSanPham = "";
            objTH.KhoaHopDong = "";
            objTH.LoaiTien = this.CboLoaiTien.SelectedValue.ToString().Trim();
            objTH.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            objTH.TienHangNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienHang = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHang.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhau.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienThueVATNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienThueVAT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThue.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.DaThanhToanNT = 0.0;
            objTH.DaThanhToan = 0.0;
            objTH.NguonNhap = "TH";
            objTH.KhoaNhanVienTao = modGeneral.H_USERID;
            objTH.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objTH.KhoaNhanVienSua = modGeneral.H_USERID;
            objTH.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objTH.GhiSo = 1;
            objTH.KhoaDonVi = modGeneral.H_CLIENT;
            objTH.Send = 0;
            objTH.DienGiai = this.TxtDienGiai.Text;
            objTH.KhoaTKThanhToan = this.AdvTaiKhoanCo.Value;
            objTH.KhoaTKNoThueVAT = this.AdvTaiKhoanThue.Value;
            objTH.KhoaTKCoThueVAT = this.AdvTaiKhoanTraHang.Value;
            objTH.KhoaHangMucBaoCaoThue = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboKhaiThue.SelectedValue), "", modGeneral.TypeOfValue.Nothing));
            objTH.SoSeri = this.TxtSoSeri.Text;
            objTH.SoHoaDon = this.TxtSoHoaDon.Text.ToString().Trim();
            objTH.NgayHoaDon = LVYModule.Date2Char(this.TxtNgayHoaDon.Text.ToString().Trim());
            objTH.SoSeri = this.TxtSoSeri.Text.ToString().Trim();
            objTH.MaSoThue = this.txtMST.Text;
            objTH.KhoaLoaiHoaDon = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.Nothing));
            objTH.ThueSuat = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value), 0, modGeneral.TypeOfValue.Nothing));
            return objTH.Save();
            objTH = null;
            return obj2;
        }

        private void VSList_AfterEdit(object sender, RowColEventArgs e)
        {
            object obj2;
            string expression = "";
            switch (e.Col)
            {
                case 2:
                    expression = SearchModule.SearchStore(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, e.Col]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (expression.Trim() == "")
                    {
                        this.VSlist[e.Row, 1] = "";
                        this.VSlist[e.Row, 2] = "";
                        break;
                    }
                    obj2 = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                    this.VSlist[e.Row, 1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null));
                    this.VSlist[e.Row, 2] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null));
                    break;

                case 4:
                    expression = SearchModule.SearchHangHoa(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, e.Col]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), "", "");
                    if (expression.Trim() == "")
                    {
                        this.VSlist[e.Row, 3] = "";
                        this.VSlist[e.Row, 4] = "";
                        this.VSlist[e.Row, 5] = "";
                    }
                    else
                    {
                        try
                        {
                            obj2 = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                            this.VSlist[e.Row, 3] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null));
                            this.VSlist[e.Row, 4] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null));
                            this.VSlist[e.Row, 5] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 2 }, null));
                            this.VSlist[e.Row, 10] = "";
                            this.VSlist[e.Row, 11] = "";
                            this.VSlist[e.Row, 12] = 0;
                            clsDMHangHoa hoa = new clsDMHangHoa();
                            DataTable hangHoa = hoa.GetHangHoa(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null).ToString());
                            this.VSlist[e.Row, 10] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaDonViTinh"]);
                            this.VSlist[e.Row, 11] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["DonViTinh"]);
                            this.VSlist[e.Row, 12] = 1;
                            this.VSlist[e.Row, 0x16] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaTKHangHoa"]);
                            this.VSlist[e.Row, 0x17] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["TaiKhoanHangHoa"]);
                            this.VSlist[e.Row, 0x18] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaTKGiaVon"]);
                            this.VSlist[e.Row, 0x19] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["TaiKhoanGiaVon"]);
                            this.VSlist[e.Row, 0x10] = hoa.GetGiaMua(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim(), NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null).ToString());
                        }
                        catch (Exception exception1)
                        {
                            ProjectData.SetProjectError(exception1);
                            Exception exception = exception1;
                            ProjectData.ClearProjectError();
                        }
                    }
                    if (this.OptGiaVon.Checked)
                    {
                        string pLoai = "GK";
                        this.VSlist[e.Row, 0x10] = this.objTH.GetGiaVon(Conversions.ToString(this.VSlist[e.Row, 1]), Conversions.ToString(this.VSlist[e.Row, 3]), pLoai, LVYModule.Date2Char(this.TxtNgayChungTu.Text));
                    }
                    this.VSlist.Select(e.Row, 13);
                    goto Label_0853;

                case 11:
                case 12:
                    this.TinhTienVon(e.Row);
                    this.TinhTienBan(e.Row);
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    goto Label_0853;

                case 13:
                case 14:
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoChungTuBan.Tag), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                    {
                        string pKhoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                        this.objHDCT.Load(pKhoa);
                        if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 13]), 0, modGeneral.TypeOfValue.Nothing)) > this.objHDCT.SoLuong)
                        {
                            LVYModule.ShowWarning(modGeneral.Tranlated("Số lượng trả lại phải nhỏ hơn hoặc bằng số lượng mua!", ""));
                            this.VSlist[e.Row, 13] = this.objHDCT.SoLuong;
                        }
                    }
                    this.TinhTienBan(e.Row);
                    this.TinhTienVon(e.Row);
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    goto Label_0853;

                case 0x10:
                    this.TinhTienVon(e.Row);
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    goto Label_0853;

                case 0x12:
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    goto Label_0853;

                case 0x13:
                    this.TinhThue(e.Row);
                    goto Label_0853;

                case 20:
                    this.TinhThue(e.Row);
                    goto Label_0853;

                default:
                    goto Label_0853;
            }
            if (e.Row < (this.VSlist.Rows.Count - 1))
            {
                int num4 = this.VSlist.Rows.Count - 1;
                for (int i = e.Row + 1; i <= num4; i++)
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        this.VSlist[i, 1] = RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 1]);
                        this.VSlist[i, 2] = RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 2]);
                    }
                }
            }
            this.VSlist.Select(e.Row, 4);
        Label_0853:
            this.TinhTong();
        }

        private void VSList_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if ((e.Col == 5) | (e.Col == 12))
            {
                e.Cancel = true;
            }
        }

        internal virtual ADVObjects AdvKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvKhachHang_ValueChanged);
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged -= handler;
                }
                this._AdvKhachHang = value;
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVAccount AdvTaiKhoanCo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanCo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanCo = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanThue = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanTraHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanTraHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanTraHang = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual ComboBox CboKhaiThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboKhaiThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboKhaiThue = value;
            }
        }

        internal virtual ComboBox CboLoaiHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiHoaDon_SelectedIndexChanged);
                if (this._CboLoaiHoaDon != null)
                {
                    this._CboLoaiHoaDon.SelectedIndexChanged -= handler;
                }
                this._CboLoaiHoaDon = value;
                if (this._CboLoaiHoaDon != null)
                {
                    this._CboLoaiHoaDon.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdBoGhiSo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdBoGhiSo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdBoGhiSo_Click);
                if (this._CmdBoGhiSo != null)
                {
                    this._CmdBoGhiSo.Click -= handler;
                }
                this._CmdBoGhiSo = value;
                if (this._CmdBoGhiSo != null)
                {
                    this._CmdBoGhiSo.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDelRow_Click);
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click -= handler;
                }
                this._CmdDelRow = value;
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdGhiSo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdGhiSo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdGhiSo_Click);
                if (this._CmdGhiSo != null)
                {
                    this._CmdGhiSo.Click -= handler;
                }
                this._CmdGhiSo = value;
                if (this._CmdGhiSo != null)
                {
                    this._CmdGhiSo.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button CmdTimHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTimHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdTimHoaDon_Click);
                if (this._CmdTimHoaDon != null)
                {
                    this._CmdTimHoaDon.Click -= handler;
                }
                this._CmdTimHoaDon = value;
                if (this._CmdTimHoaDon != null)
                {
                    this._CmdTimHoaDon.Click += handler;
                }
            }
        }

        internal virtual Button CmdTimSeri
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTimSeri;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdTimSeri_Click);
                if (this._CmdTimSeri != null)
                {
                    this._CmdTimSeri.Click -= handler;
                }
                this._CmdTimSeri = value;
                if (this._CmdTimSeri != null)
                {
                    this._CmdTimSeri.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdAddRow.Enabled = value;
                this.CmdDelRow.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.AdvKhachHang.ReadOnly = !value;
                this.AdvTaiKhoanCo.ReadOnly = !value;
                this.TxtNguoiGiao.ReadOnly = !value;
                this.AdvTaiKhoanTraHang.ReadOnly = !value;
                this.AdvTaiKhoanThue.ReadOnly = !value;
                this.CmdBoGhiSo.Enabled = !value & this.mAllowAdd;
                this.CmdGhiSo.Enabled = !value & this.mAllowAdd;
                this.CmdTimHoaDon.Enabled = value;
                this.PNSerial.Enabled = value;
                this.txtMST.ReadOnly = !value;
                this.TxtSoHoaDon.ReadOnly = !value;
                this.TxtSoSeri.ReadOnly = !value;
                this.TxtNgayHoaDon.Enabled = value;
                this.CboKhaiThue.Enabled = value;
                this.CboLoaiHoaDon.Enabled = value;
                this.TxtThueSuat.ReadOnly = !value;
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual GroupBox GroupBox2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox2 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label21
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label21;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label21 = value;
            }
        }

        internal virtual Label Label22
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label22;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label22 = value;
            }
        }

        internal virtual Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual RadioButton OptDonGiaMua
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OptDonGiaMua;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._OptDonGiaMua = value;
            }
        }

        internal virtual RadioButton OptGiaVon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OptGiaVon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._OptGiaVon = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual Panel PNSerial
        {
            [DebuggerNonUserCode]
            get
            {
                return this._PNSerial;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._PNSerial = value;
            }
        }

        internal virtual TabControl TabControl2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl2 = value;
            }
        }

        internal virtual TabPage TabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage2 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripButton ToolStripButton2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChietKhau = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhauNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhauNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChietKhauNT = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual TextBox txtMST
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtMST;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtMST = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual DateTimePicker TxtNgayHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayHoaDon = value;
            }
        }

        internal virtual DateTimePicker TxtNgayXuatBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayXuatBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayXuatBan = value;
            }
        }

        internal virtual TextBox TxtNguoiGiao
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNguoiGiao;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNguoiGiao = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual TextBox TxtSoChungTuBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTuBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTuBan = value;
            }
        }

        internal virtual TextBox TxtSoHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoHoaDon = value;
            }
        }

        internal virtual TextBox TxtSoSeri
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoSeri;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoSeri = value;
            }
        }

        internal virtual TextBox TxtSoSerial
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoSerial;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoSerial = value;
            }
        }

        internal virtual C1NumericEdit TxtThueSuat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtThueSuat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtThueSuat = value;
            }
        }

        internal virtual C1NumericEdit TxtTienHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHang = value;
            }
        }

        internal virtual C1NumericEdit TxtTienHangNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHangNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHangNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThue = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThueNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThueNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThueNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToan = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToanNT = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtTyGia = value;
            }
        }

        public virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSList_AfterEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSList_BeforeEdit);
                if (this._VSlist != null)
                {
                    this._VSlist.AfterEdit -= handler;
                    this._VSlist.BeforeEdit -= handler2;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.AfterEdit += handler;
                    this._VSlist.BeforeEdit += handler2;
                }
            }
        }
    }
}

